<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>下雪</title>
    <style>
        body{
            margin: 0;
            background-color: black;
        }
        img{
            position: absolute;
        }
    </style>
</head>
<body>
<script src="../js/jquery-1.4.2.js"></script>
<script>
   setInterval(function () {
       let  w=$(window).width();
       let  h=$(window).height();
       let img=$("<img src='../image/snow.png'>")
       //得到20到40随机数
       let size=parseInt(Math.random()*21)+20;
       //得到随机的x轴的值 0
       let left=parseInt(Math.random()*(w-size));
       img.css({"width":size+"px","left":left+"px"});
       $("body").append(img);
       //让雪花图片向下移动
       img.animate({"top":h-size+"px"},size*100)
       .fadeOut(1000,function () {
          img.remove();
       });
   },10)
</script>
</body>
</html>